<template>
  <mt-header :title="title" class="bar bar-light">
    <div slot="left">
      <mt-button icon="back" @click="goBack"></mt-button>
    </div>
    <mt-button slot="right" icon="more"></mt-button>
  </mt-header>
</template>
<script>
export default {
  props: {
    title: {
      type: String,
      default: '标题'
    }
  },
  methods: {
    goBack (e) {
      if (window.history.length > 1) {
        e.preventDefault();
        window.history.back();
        return false;
      }
      return true;
    }
  }
}
</script>
